package kycprovider

import (
	"code.bydev.io/cht/customer/kyc_admin_service/internal/config"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/dto"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/provider"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/provider/jumio"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/provider/onfido"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/provider/sumsub"
	"go.uber.org/zap"
)

func NewProvider(logger *zap.Logger, kycProvider dto.KYCProvider, teller provider.Teller) KycProvider {
	switch kycProvider {
	case dto.ProviderSumSub:
		return sumsub.NewSumSubProvider(config.GetProviderConfig().Sumsub, logger, teller)
	case dto.ProviderJumio:
		return jumio.NewJUMIOProvider(config.GetProviderConfig().Jumio, logger, teller)
	case dto.ProviderOnfido:
		return onfido.NewOnfidoProvider(config.GetProviderConfig().Onfido, logger, teller)
	}
	return nil
}
